<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Promise封装 | 10-异步任务 then 返回结果</title>
	<script src="./promise.js"></script>
</head>
<body>
	<script>
		// 实例化对象
		let p = new Promise((resolve,reject)=>{
			setTimeout(()=>{
				resolve('OK')
				//reject('error')
			},100)
		})
		// 执行 then 方法
		const res = p.then(value =>{
			console.log(value)
		},reason=>{
			console.warn(reason)
		})
		console.log(res);
	</script>
</body>
</html>